package com.stock.config;

import com.stock.properties.IdWorkerProperties;
import com.stock.util.IdWorkers;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class IdWorkerConfiguration {

    @Bean
    public IdWorkers idWorkers(IdWorkerProperties properties) {
        return new IdWorkers(properties.getMachineId(), properties.getDataCenterId());
    }

}
